<?php
$lc_title   = isset($_POST['lc_title'])?escape_str($_POST['lc_title']):null;
$lc_jiguan  = isset($_POST['lc_jiguan'])?escape_str($_POST['lc_jiguan']):null;
$lc_qq      = isset($_POST['lc_qq/email'])?escape_str($_POST['lc_qq/email']):null;
$lc_tel     = isset($_POST['lc_tel'])?escape_str($_POST['lc_tel']):null;
$lc_techang = isset($_POST['lc_techang'])?escape_str($_POST['lc_techang']):null;
$lc_years   = isset($_POST['lc_years'])?escape_str($_POST['lc_years']):null;
$lc_kaocha  = isset($_POST['lc_kaocha'])?escape_str($_POST['lc_kaocha']):null;
$lc_gbook  = isset($_POST['lc_gbook'])?escape_str($_POST['lc_gbook']):null;
$yzm        = isset($_POST['yzm'])?$_POST['yzm']:null;//验证码
$yzm = strtoupper(trim($yzm));//将验证码转换为大写且清除空格和其他符号


if(empty($lc_title)){
    mx_msg("亲，请写姓名!","1");
}
elseif(empty($lc_jiguan)){
    mx_msg("亲，请写地区!","1");
}
elseif(empty($lc_qq)){
    mx_msg("亲，请填写您的qq或者邮箱!","1");
}
elseif(empty($lc_tel)){
    mx_msg("亲，请写联系方式!","1");
}
elseif(empty($lc_techang)){
    mx_msg("亲，请填写您从事的行业!","1");
}
elseif(empty($lc_years)){
    mx_msg("亲，请选择从事年限!","1");
}
elseif(empty($lc_kaocha)){
    mx_msg("亲，请选择考察重点!","1");
}
elseif(empty($lc_gbook)){
    mx_msg("亲，请填写留言!","1");
}
elseif (empty($yzm)){
    mx_msg("亲，请填写验证码","1");
}
else{
    if($yzm == $_SESSION['validationcode']){

        $sql = "INSERT INTO mx_jianli SET `lc_title`='{$lc_title}',`lc_jiguan`='{$lc_jiguan}',`lc_qq`='{$lc_qq}',`lc_tel`='{$lc_tel}',`lc_techang`='{$lc_techang}',`lc_kaocha`='{$lc_kaocha}',`lc_years`='{$lc_years}',`lc_gbook`='{$lc_gbook}',`lc_datetime`= NOW()";
        $rs = mysql_query($sql);
        if($rs){
        mx_msg("加盟申请提交成功","index.php?p=jiameng");
        }
        else{
        mx_msg("提交失败","1");
         }
    }
    else{
        mx_msg("亲，验证码不正确，请重新填写！","1");
    }
}




?>